package m.base.action;

import m.appserver.AuthInfoUtil;
import m.base.model.UserInfo;
import m.base.util.PowerUtil;
import m.common.model.UserModel;
import m.system.util.StringUtil;
import manage.action.ManageAction;
import manage.model.OrgGroupView;

public abstract class BaseAction extends ManageAction {
    @Override
    public UserModel getSessionLogUser() {
        try {
            return PowerUtil.getSessionUser();
        }catch (Exception e){
            return null;
        }
    }
    @Override
    public OrgGroupView getSessionOrgGroup() {
        try {
            return PowerUtil.getSessionStore();
        } catch (Exception e) {
            return null;
        }
    }
    @Override
    public void beforeExecute() throws Exception {
        String[] arr= StringUtil.noSpace(getAuthorization()).split(" ");
        String key=arr.length>1?arr[1]:"";
        PowerUtil.setAppKey(key);
    }
}
